home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / MorphOS / Epic4_mos / share / epic / help / 5_programming / input < prev    next >
Encoding:
Text File  |  2002-10-28  |  1.2 KB  |  39 lines

  1. Synopsis:
  2.    input      "<prompt>" <command> [<arguments>]
  3.    input_char "<prompt>" <command> [<arguments>]
  4.  
  5. Description:
  6.    This command is primarily for use inside scripts.  It allows the client
  7.    to present the user with a visible prompt for specific commands.  This
  8.    can be used for interactive commands, for command confirmation, etc.
  9.    Multiple commands may be specified if surrounded with curly braces.
  10.  
  11.    The variant INPUT_CHAR words the same as INPUT, except it only takes a
  12.    single character.  The primary difference is that it does not require
  13.    that a carriage return be entered before executing the command; the first
  14.    keystroke will trigger it.
  15.  
  16. Options:
  17.    -noecho    stops the echoing of characters as they are typed
  18.  
  19. Examples:
  20.    To let a command ask for confirmation:
  21.       input "Are you REALLY sure you want to do this? (y/n) " {
  22.          if ( [$0] == [y] ) exec rm -rf *
  23.       }
  24.  
  25.    The basis for a simple paging mechanism:
  26.       input_char "Press 'q' to quit, any other key to continue: " {
  27.          unless ( [$0] == [q] ) {
  28.             /* do whatever */
  29.          }
  30.       }
  31.  
  32. Aliases:
  33.    These commands are functionally equivalent to the $"..." expando.  In
  34.    truth, they supersedes $"...".
  35.  
  36. See Also:
  37.    Special_Vars(7)
  38.  
  39.